public class Test {
    public static void main(String[] args) {
        String str1=new String("hello");
        String str2=new String("hello");
        String str3=new String("he");
        System.out.println(str1.equals(str2));//true
        System.out.println(str1.equals(str3));//false
    }
}
